//
//  SettingController.m
//  Clock
//
//  Created by Le Thanh Hai on 10/12/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "SettingController.h"


@implementation SettingController
@synthesize btnBack;
@synthesize btnSettingClock;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
}



- (IBAction)backView
{
    [self dismissModalViewControllerAnimated:YES];
}

- (IBAction)settingClock
{
    NSLog(@"clock");
    if (stClock == NULL) {
        stClock = [[SettingClock alloc] init];
    }
    [self presentModalViewController:stClock animated:YES];
}

- (IBAction)settingAlarm
{
    NSLog(@"alarm");
    if (stAlarm == NULL) {
        stAlarm = [[SettingAlarm alloc] init];
    }
    [self presentModalViewController:stAlarm animated:YES];
}

- (IBAction)gallery
{
    NSLog(@"gallery");
    if (gallery == NULL) {
        gallery = [[GalleryController alloc] init];
    }
    [self presentModalViewController:gallery animated:YES];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
